#include<bits/stdc++.h>

int main()
{
	float s, v;
	scanf("%f %f", &s, &v);
	int sumMinute = std::ceil(s / v) + 10;
	int hour = std::ceil(sumMinute / 60.0);
	int minute = sumMinute % 60;
	int ans1, ans2;
	if (hour > 8)
		ans1 = 32 - hour;
	else
		ans1 = 8 - hour;

	ans2 = 60 - minute;

	/*if (ans1 < 10)
		printf("0%d:%d", ans1, ans2);
	else
		printf("%d:%d", ans1, ans2);*/

    if (ans1 < 10)
		printf("0%d:", ans1);
	else
		printf("%d:", ans1);
    if (ans2 < 10)
		printf("0%d", ans2);
	else
		printf("%d", ans2);


	return 0;
}
